#       WeatherWeatherForecast_test.py
#       
#       Copyright 2008 Joshua Scotton <josh@joshuascotton.com>
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

__licence__ = "GPLv2"
__copyright__ = "2008, Joshua Scotton"
__author__ = "Joshua Scotton <josh@joshuascotton.com>"

import unittest
import os
import sys

sys.path += [os.path.abspath('..')]

from utils.weather import WeatherForecast

class WeatherForecastTest(unittest.TestCase):
    
    def setUp(self):
        """Sets up everything for the test"""
        self.forecast = WeatherForecast("Sat", "01/01/2008", 18, 20, "Sunny", 32, "C")
        
    def testWeatherForecast001(self):
        """testWeatherForecast001: Tests if day is set correctly"""
        self.assertEqual(self.forecast.day,"Sat")
    def testWeatherForecast002(self):
        """testWeatherForecast002: Tests if date is set correctly"""
        self.assertEqual(self.forecast.date,"01/01/2008")
    def testWeatherForecast003(self):
        """testWeatherForecast003: Tests if low is set correctly"""
        self.assertEqual(self.forecast.low,18)
    def testWeatherForecast004(self):
        """testWeatherForecast004: Tests if high is set correctly"""
        self.assertEqual(self.forecast.high,20)
    def testWeatherForecast005(self):
        """testWeatherForecast005: Tests if text is set correctly"""
        self.assertEqual(self.forecast.text,"Sunny")
    def testWeatherForecast006(self):
        """testWeatherForecast006: Tests if code is set correctly"""
        self.assertEqual(self.forecast.code,32)
    def testWeatherForecast007(self):
        """testWeatherForecast007: Tests if type is set correctly"""
        self.assertEqual(self.forecast.type,"C")
    def testWeatherForecastToString(self):
        """testWeatherForecastToString: Tests if string representation is correct"""
        self.assertEqual(self.forecast.to_string(), "Sat 01/01/2008, 18C:20C, Sunny (32)")
        
        
        
        
